package com.blackitheima3.LambdaDemo;

public class TestSwimming {
    public static void main(String[] args) {
        //匿名内部类
        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("黑子,身体放平!");
            }
        });
        //Lambda 表达式
        goSwimming(()-> System.out.println("黑子,来,蹬腿!"));

    }
    public static void goSwimming(Swimming swimming){
        swimming.swim();
    }
}
interface Swimming{
    public abstract void swim();
}


